<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
    <div id="ribbon">
        <ol class="breadcrumb pull-right">
            <li><a href="javascript:;">主页</a></li>
            <li><a href="javascript:;">规则管理</a></li>
        </ol>
    </div>
    <div class="content">
      <div class="panel panel-default panel-intro">
          <div class="panel-heading">
              <div class="panel-lead"><em>WAF防护规则</em>所有的防护规则存放的地方，用于web攻击防护。</div>
              <ul class="nav nav-tabs">
                  <li class="active"><a href="#listwafrule" data-toggle="tab" aria-expanded="true">规则列表</a></li>
                  <li class=""><a href="#addwafrule" data-toggle="tab" aria-expanded="false">添加规则</a></li>
              </ul>
          </div>
          <div class="panel-body">
              <div id="myTabContent" class="tab-content">
                  <div class="tab-pane fade active in" id="listwafrule">
                      <div class="widget-body no-padding">
                          <div class="panel panel-default panel-intro">
                              <div class="panel-body">
                                <div class="widget-body no-padding">
                                  <div id="toolbar" class="toolbar">
                                      <a href="javascript:;" class="btn btn-primary btn-refresh" ><i class="fa fa-refresh"></i> </a>
                                      <div class="dropdown btn-group">
                                          <a class="btn btn-primary btn-more dropdown-toggle btn-disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> 批量作业</a>
                                          <ul class="dropdown-menu text-left" role="menu">
                                              <li><a class="btn btn-link btn-multi btn-disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> 设置阻断</a></li>
                                              <li><a class="btn btn-link btn-multi btn-disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> 设置放行</a></li>
                                              <li><a class="btn btn-link btn-multi btn-disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> 设置禁用</a></li>
                                          </ul>
                                      </div>
                                      <a class="btn btn-success btn-singlesearch" href="javascript:;"><i class="fa fa-search"></i> 自定义搜索</a>
                                  </div>
                                  <!-- table表格 -->
                                  <table id="wafruletable" class="table table-striped table-bordered table-hover" width="100%"></table>
                                </div>
                              </div>
                          </div>
                      </div>
                  </div>

                  <div class="tab-pane fade" id="addwafrule">
                      <div class="widget-body no-padding">
                        <form class="behind_form">
                            <table class="table table-striped">
                                <tbody>
                                    <tr>
                                        <td>规则名称</td>
                                        <td>
                                            <div class="row">
                                              <div class="col-sm-8 col-xs-12">
                                                  <input type="text" name="wafrule_name" value="" class="form-control">
                                              </div>
                                              <div class="col-sm-4 col-xs-12 bsty">
                                                <span style="color: #808080;">给规则设置一个别名</span>
                                              </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>规则类型</td>
                                        <td>
                                            <div class="row">
                                              <div class="col-sm-8 col-xs-12">
                                                  <select name="wafruleType" id="wafruleType" class="form-control selectpicker">
                                                      <option value="0" selected>请选择</option>
                                                      <option value="010100">攻击规则 - WEB攻击 </option>
                                                      <option value="010101">攻击规则 - CC防护</option>
                                                      <option value="020101">业务规则 - 全局规则 - 公司ID规则</option>
                                                      <option value="020102">业务规则 - 全局规则 - 用户ID规则</option>
                                                      <option value="020103">业务规则 - 全局规则 - 关键字ID规则</option>
                                                      <option value="020201">业务规则 - 多业务关联限制 - 投递简历</option>
                                                      <option value="020202">业务规则 - 多业务关联限制 - 修改简历</option>
                                                      <option value="020203">业务规则 - 多业务关联限制 - 上架职位</option>
                                                      <option value="020204">业务规则 - 多业务关联限制 - 刷新职位</option>
                                                      <option value="020205">业务规则 - 多业务关联限制 - 修改密码</option>
                                                      <option value="020206">业务规则 - 多业务关联限制 - 查联系方式</option>
                                                      <option value="020207">业务规则 - 多业务关联限制 - 删除职位</option>
                                                      <option value="020208">业务规则 - 多业务关联限制 - 下载简历</option>
                                                      <option value="020200">业务规则 - 多业务关联限制 - 其它</option>
                                                  </select>
                                              </div>
                                              <div class="col-sm-4 col-xs-12 bsty">
                                                <span style="color: #808080;">给事件设置一个优先级</span>
                                              </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr class="id010100">
                                        <td>正则匹配</td>
                                        <td>
                                            <div class="row">
                                              <div class="col-sm-8 col-xs-12">
                                                <input type="text" name="wafrule_reg" value="" class="form-control">
                                              </div>
                                              <div class="col-sm-4 col-xs-12 bsty">
                                                <span style="color: #808080;">正则的base64编码后的规则</span>
                                              </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr class="id010100">
                                        <td>属性添加</td>
                                        <td>
                                            <div class="row">
                                              <div class="col-sm-8 col-xs-12">
                                                <div>
                                                  <a style="width: 100px;" class="wafruleviewclientip-add btn btn-warning btn-embossed">clientip+</a>&nbsp;
                                                  <a style="width: 100px;" class="wafruleviewreferer-add btn btn-info btn-embossed">referer+</a>&nbsp;
                                                  <a style="width: 100px;" class="wafruleviewuseragent-add btn btn-danger btn-embossed">useragent+</a>
                                                </div>
                                                  </br>
                                                  <div id="clientip">
                                                    <p>clientip:</p>
                                                    <div>
                                                      <input type="text" name="wafrule_clientip" value="" class="form-control" style="float: left; width: 97%;">&nbsp;
                                                      <a data-toggle="tooltip" title="删除" class="fa fa-trash-o" href="#" onclick="new MainFeatures().wafRuleAddView('id010100_removeself',this);"></a>
                                                    </div>

                                                  </div></br></br>
                                                  <div id="referer">
                                                    <p>referer:</p>
                                                    <div>
                                                      <input type="text" name="wafrule_referer" value="" class="form-control" style="float: left; width: 97%;">&nbsp;
                                                      <a data-toggle="tooltip" title="删除" class="fa fa-trash-o" href="#" onclick="new MainFeatures().wafRuleAddView('id010100_removeself',this);"></a>
                                                    </div>
                                                  </div></br></br>
                                                  <div id="useragent">
                                                    <p>useragent:</p>
                                                    <div>
                                                      <input type="text" name="wafrule_useragent" value="" class="form-control" style="float: left; width: 97%;">&nbsp;
                                                      <a data-toggle="tooltip" title="删除" class="fa fa-trash-o" href="#" onclick="new MainFeatures().wafRuleAddView('id010100_removeself',this);"></a>
                                                    </div>
                                                  </div>


                                              </div>
                                              <div class="col-sm-4 col-xs-12 bsty">
                                                <span style="color: #808080;">单击要到添加的属性</span>
                                              </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr class="id010100">
                                        <td>攻击规则状态</td>
                                        <td>
                                            <div class="row">
                                              <div class="col-sm-8 col-xs-12">
                                                  <select name="wafrule_status" class="form-control selectpicker">
                                                      <option value="1">block</option>
                                                      <option value="2">simulation</option>
                                                  </select>
                                              </div>
                                              <div class="col-sm-4 col-xs-12 bsty">
                                                <span style="color: #808080;">攻击规则状态设置(block/simulation)</span>
                                              </div>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                                <tfoot>
                                    <tr>
                                        <td></td>
                                        <td>
                                            <a class="wafrule-add btn btn-success btn-embossed">提交规则</a>
                                            <a class="behind-return btn btn-default btn-embossed">返回列表</a>
                                        </td>
                                        <td></td>
                                    </tr>
                                </tfoot>
                            </table>
                        </form>
                      </div>
                  </div>
              </div>
          </div>
      </div>
    </div>
  </div>
</div>
<? 
  include getcwd().'/webapp/application/views/model/wafrule.php';
?>
